package com.sumainfor.pc.epc.controller.master;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.pc.epc.service.CommodityService;
import com.sumainfor.pc.epc.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 */
@RestController
@RequestMapping("/master/Order")
public class OrderController implements Serializable{

    @Autowired
    private OrderService orderService;
    /**
     * 根据商品类型查询商品的名称和编号
     * @param params
     * @return
     */
    @RequestMapping(value = "/getOrderCountBySysUserId",method = RequestMethod.GET)
    public JsonResult getCommodityByComType(@RequestParam Map<String,Object>params){
        JsonResult result=new JsonResult();
        Integer count=orderService.getOrderCountBySysUserId(params);

        if (count!=null){
            result.put(count);
        }else{
            System.out.println("count:"+count);
            result.putFailed("服务器繁忙");
        }
        return result;
    }
}
